#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	char a[100]={'0','A','B','C','D','E','F'};
	cin>>n;
	if(n%5 == 0)
		n/5%2==0?cout<<a[2]:cout<<a[5];
	else
		n/5%2==0?cout<<a[n%5]:cout<<a[7-n%5];
    return 0;
}
